using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using SalesPages.DomainModel;
namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class GamePlayerEmailMap : EntityTypeConfiguration<GamePlayerEmail>
    {
        public GamePlayerEmailMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.PlayerName)
                .IsRequired()
                .HasMaxLength(30);

            this.Property(t => t.PlayerEmail)
                .IsRequired()
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("GamePlayerEmail");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.PlayerName).HasColumnName("PlayerName");
            this.Property(t => t.PlayerEmail).HasColumnName("PlayerEmail");
            this.Property(t => t.DateSubmit).HasColumnName("DateSubmit");
        }
    }
}
